package day3;

/**
 * Created with IntelliJ IEDA.
 * Description:
 * User:86186
 * Date:2022-10-11
 * Time:23:33
 */
import java.util.Scanner;

/**
 * 读入一个字符串,,输出字符串中的连续最长的字符串
 */
//// 注意类名必须为 Main, 不要有任何 package xxx 信息
//public class Main {
//    public static void main(String[] args) {
//        Scanner scanner = new Scanner(System.in);
//        String str = scanner.nextLine();
//        //abcd12345ed125ss123456789
//        String s1 = "";
//        String s2 = "";
//        int len = str.length();
//        for (int i = 0; i < len; i++) {
//            char ch = str.charAt(i);
//            if (ch >= '0' && ch <= '9'){
//                s1  = s1 + ch;
//            }else {
//                if (s1.length() > s2.length()){
//                    s2 = s1;
//                }
//            }
//            s1 = "";
//        }
//        System.out.println(s2.toString());
//    }
//}
public class Main{
    public static void main(String[] args) {
        //利用了字符串的拼接
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        String cur = "";
        String ret = "";

        //寻找连续的数字串
        for(int i = 0;i < str.length();i++) {
            char ch = str.charAt(i);
            if(ch <= '9'&&ch >= '0') {
                cur = cur + ch;
            }else {
                //相当于针对字符串的Math.max()操作
                if(cur.length() > ret.length()) {
                    ret = cur;
                }
                cur = "";
            }
        }
//        //防止出现123abc123456的情况,即最后一个字符为数字的情况
//        if(cur.length() > ret.length()){
//            ret = cur;
//        }
        System.out.println(ret);
    }
}